from tkinter import*
x= int(input("Введите начальную координату X: "))
y= int(input("Введите начальную координату Y: "))
n= int(input("Введите коэффицент увеличения: "))

if n == 0 and x > 0 and x <= 500 and y > 0 and y <= 500:
    pass
else:
    if n > 0 and 0*n+x >= 0 and 20*n+x <= 500 and 0*n+y >= 0 and 20*n+y <= 500:
        pass
    if n > 0 and 20*n+x >= 0 and 20*n+y <= 500 and 0*n+y <= 500 and 0*n+x <= 500:
        pass
    else:
        print("Размер фигуры превышает максимальный размер")
        exit()
    
root = Tk()
root.title("IT-марафон")
root.geometry("500x500")

canvas = Canvas(bg="gray", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)

canvas.create_rectangle((x+0)*n, (y+0)*n, (x+10)*n, (y+30)*n, fill="black", outline="black")
canvas.create_rectangle((x+10)*n, (y+10)*n, (x+20)*n, (y+20)*n, fill="black", outline="black")

root.mainloop()
